package com.example.infrastructure.persistence.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.infrastructure.common.BasePO;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 支付订单表 PO
 *
 * @author wangal
 * @since 2025-07-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("payment_orders")
@Schema(name = "PaymentOrders", description = "支付订单表")
public class PaymentOrders extends BasePO {

    private static final long serialVersionUID = 1L;

    @Schema(description = "订单号")
    @TableField("order_no")
    private String orderNo;

    @Schema(description = "用户ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "订单类型：1问诊费，2药品费，3挂号费")
    @TableField("order_type")
    private Byte orderType;

    @Schema(description = "关联ID(问诊ID或处方ID或预约ID)")
    @TableField("related_id")
    private Long relatedId;

    @Schema(description = "订单标题")
    @TableField("order_title")
    private String orderTitle;

    @Schema(description = "订单金额")
    @TableField("amount")
    private BigDecimal amount;

    @Schema(description = "优惠金额")
    @TableField("discount_amount")
    private BigDecimal discountAmount;

    @Schema(description = "实付金额")
    @TableField("actual_amount")
    private BigDecimal actualAmount;

    @Schema(description = "支付方式：0未支付，1微信支付，2支付宝，3余额支付")
    @TableField("payment_method")
    private Byte paymentMethod;

    @Schema(description = "状态：0待支付，1已支付，2已退款，3已取消，4支付失败")
    @TableField("status")
    private Byte status;

    @Schema(description = "第三方支付交易号")
    @TableField("trade_no")
    private String tradeNo;

    @Schema(description = "支付时间")
    @TableField("pay_time")
    private LocalDateTime payTime;

    @Schema(description = "退款时间")
    @TableField("refund_time")
    private LocalDateTime refundTime;

    @Schema(description = "退款原因")
    @TableField("refund_reason")
    private String refundReason;

    @Schema(description = "过期时间")
    @TableField("expire_time")
    private LocalDateTime expireTime;

    @Schema(description = "租户编号")
    @TableField("tenant_id")
    private Long tenantId;


}